//
//  OKTableViewCell.swift
//  Community
//
//  Created by JKSD on 2019/8/5.
//  Copyright © 2019 ZKJ. All rights reserved.
//

import UIKit

class OKTableViewCell: UITableViewCell {
    @IBOutlet weak var img: UIImageView!
    @IBOutlet weak var name: UILabel!
    @IBOutlet weak var explain: UILabel!
    @IBOutlet weak var contain: UILabel!
    @IBOutlet weak var tip: UILabel!
    
    @IBOutlet weak var bgView: UIView!
    @IBOutlet weak var type: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        self.bgView.layer.cornerRadius = 5
        self.bgView.clipsToBounds = true
    }

  open  func fillCell(model:indexModel) {
        self.name.text = model.name
        self.explain.text = model.explain
        self.contain.text = model.contain
        self.tip.text = model.tip
//        0 为可回收、1 为有害、2 为厨余(湿)、3 为其他(干)
        if model.type == "0" {
            self.type.text = "可回收垃圾"
            self.img.image = UIImage.init(named: "回收.jpg")
        }else if model.type == "1"{
            self.type.text = "有害垃圾"
            self.img.image = UIImage.init(named: "有害.jpg")
        }else if model.type == "2"{
            self.type.text = "湿垃圾"
            self.img.image = UIImage.init(named: "湿垃圾.jpg")
        }else if model.type == "3"{
            self.type.text = "干垃圾"
            self.img.image = UIImage.init(named: "干垃圾.jpeg")
        }
    }
    
}
